﻿@model Kooboo.CMS.Sites.ABTest.ABRuleSetting
@using Kooboo.CMS.Sites.ABTest;
@{
    ViewBag.Title = "Edit A/B rule".Localize();
    Layout = "~/Views/Shared/Blank.cshtml";

    var allRules = Kooboo.CMS.Common.Runtime.EngineContext.Current.ResolveAll<IVisitRule>();
    string ruleType = Model.RuleType;
    ViewBag.Rule = allRules.Where(it => it.RuleType.EqualsOrNullEmpty(ruleType, StringComparison.OrdinalIgnoreCase)).First();
}
@section Panel{
    <ul class="panel">
        <li>
            <a id="submitVisitRule">
                @Html.IconImage("save") @("Save".Localize())</a>
        </li>
        @foreach (var group in Kooboo.CMS.Sites.Extension.UI.TopToolbar.ToolbarButtons.GetToolbarButtons(ViewContext.RequestContext))
        {
            @Html.Partial("_ToolbarGroupButtons", group)
        }
        <li>
            <a href="@ViewContext.RequestContext.GetRequestValue("return")">
                @Html.IconImage("cancel") @("Back".Localize())</a>
        </li>

    </ul>
}

<div class="common-form block">
    <form id="ruleSettingForm">
        <h1 class="title">@ViewBag.Title: <strong>@ViewContext.RequestContext.GetRequestValue("UUID")</strong></h1>
        @Html.Partial("_RuleSetting", ViewData)
    </form>
</div>

@Html.Partial("_RuleSetting.Scripts", ViewData)


